home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM BV3 / BMUG PD-ROM Version BV3 (CDRM1097900).iso / HyperCard / XCMDs⁄XFCN / Color Icons⁄Windows / Color Icons_Windows / cards.xml < prev    next >
Text File  |  1991-03-07  |  8KB  |  117 lines

  1. card_2848.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>2848</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_3653.pbm</bitmap>
  8.     <cantDelete> <false /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>2772</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_3255.css" />
  13.     <part>
  14.         <id>3</id>
  15.         <type>button</type>
  16.         <visible> <true /> </visible>
  17.         <reserved5> 0 </reserved5>
  18.         <reserved4> 0 </reserved4>
  19.         <reserved3> 0 </reserved3>
  20.         <reserved2> 0 </reserved2>
  21.         <reserved1> 0 </reserved1>
  22.         <enabled> <true /> </enabled>
  23.         <rect>
  24.             <left>37</left>
  25.             <top>4</top>
  26.             <right>177</right>
  27.             <bottom>24</bottom>
  28.         </rect>
  29.         <style>shadow</style>
  30.         <showName> <true /> </showName>
  31.         <highlight> <false /> </highlight>
  32.         <autoHighlight> <true /> </autoHighlight>
  33.         <sharedHighlight> <true /> </sharedHighlight>
  34.         <family>0</family>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>0</icon>
  37.         <textAlign>center</textAlign>
  38.         <font>Chicago</font>
  39.         <textSize>12</textSize>
  40.         <textStyle>plain</textStyle>
  41.         <name>Display Color I/W's</name>
  42.         <script>on mouseUpdisplaycolorbuttonsend mouseUpon displayColorButtonsget rect of card windowput item 4 of it - item 2 of it into wHeight-- The following is a fairly arbitrary beginning location--  for my windows.put 34 into wLeftput wHeight - 40 into wTopput wLeft + 34 into wRightput wTop + 34 into wBottomput windowNames() into availableWindowsrepeat 8put any item of availableWindows into windowNameput offset(windowName,availableWindows) into startCharput startChar + length(windowName) into endChardelete char startChar to endChar of availableWindowsadd 35 to wLeftadd 35 to wRightput wLeft&","&wTop&","&wRight&","&wBottom into newRectpicture windowName,resource,rect,false,8set the rect of window windowName to newRectshow window windowNameend repeatend displayColorButtons</script>
  43.     </part>
  44.     <part>
  45.         <id>4</id>
  46.         <type>button</type>
  47.         <visible> <true /> </visible>
  48.         <reserved5> 0 </reserved5>
  49.         <reserved4> 0 </reserved4>
  50.         <reserved3> 0 </reserved3>
  51.         <reserved2> 0 </reserved2>
  52.         <reserved1> 0 </reserved1>
  53.         <enabled> <true /> </enabled>
  54.         <rect>
  55.             <left>235</left>
  56.             <top>4</top>
  57.             <right>375</right>
  58.             <bottom>24</bottom>
  59.         </rect>
  60.         <style>shadow</style>
  61.         <showName> <true /> </showName>
  62.         <highlight> <false /> </highlight>
  63.         <autoHighlight> <true /> </autoHighlight>
  64.         <sharedHighlight> <true /> </sharedHighlight>
  65.         <family>0</family>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>0</icon>
  68.         <textAlign>center</textAlign>
  69.         <font>Chicago</font>
  70.         <textSize>12</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <name>Hide Color I/W's</name>
  73.         <script>on mouseUphidecolorbuttonsend mouseUp</script>
  74.     </part>
  75.     <part>
  76.         <id>7</id>
  77.         <type>field</type>
  78.         <visible> <true /> </visible>
  79.         <dontWrap> <false /> </dontWrap>
  80.         <dontSearch> <false /> </dontSearch>
  81.         <sharedText> <false /> </sharedText>
  82.         <fixedLineHeight> <false /> </fixedLineHeight>
  83.         <autoTab> <false /> </autoTab>
  84.         <lockText> <false /> </lockText>
  85.         <rect>
  86.             <left>12</left>
  87.             <top>36</top>
  88.             <right>403</right>
  89.             <bottom>183</bottom>
  90.         </rect>
  91.         <style>scrolling</style>
  92.         <autoSelect> <false /> </autoSelect>
  93.         <showLines> <false /> </showLines>
  94.         <wideMargins> <false /> </wideMargins>
  95.         <multipleLines> <false /> </multipleLines>
  96.         <reservedFamily> 0 </reservedFamily>
  97.         <titleWidth>0</titleWidth>
  98.         <icon>0</icon>
  99.         <textAlign>left</textAlign>
  100.         <font>Geneva</font>
  101.         <textSize>9</textSize>
  102.         <textStyle>plain</textStyle>
  103.         <textHeight>12</textHeight>
  104.         <name>Text</name>
  105.         <script></script>
  106.     </part>
  107.     <content>
  108.         <layer>card</layer>
  109.         <id>7</id>
  110.         <text><span class="style4">o use this stack</span><span class="style3">:</span><span class="style1">Click the Display Color I/W's (meaning Icon/Windows) button on the right.  A random selection of 8 from a list of some 30 color objects will appear.  These are external windows, made to look like icons, and which can perform the same functions as icons.There are only two other interesting things about this stack:  1)  The presence of the 30 or so color PICTS, which people may like to strip out with Resedit or Capture or some utility;  2) The fact that the color windows move with the card window.  This is done by trapping the </span><span class="style2">moveWindow</span><span class="style1"> handler.  The scripts involved in that action are located in the stack script, and are </span><span class="style2">moveWindow</span><span class="style1">, </span><span class="style2">figureDelta</span><span class="style1">, and </span><span class="style2">updateWindows</span><span class="style1">.</span><span class="style4">To Put Color Icons Into Your Stack:</span><span class="style1">1).  Use Resedit or something like that to move color PICT images into your stacks's resource fork.  Keep a record of the names of the images.  Keep your PICT images to 32x32 pixels square.2).  Write a function like the </span><span class="style2">windowNames</span><span class="style1"> function in the stack script of this stack, except with your PICT names instead of mine (unless you use mine).3).  Copy the </span><span class="style2">moveWindow</span><span class="style1">, </span><span class="style2">figureDelta</span><span class="style1">, and </span><span class="style2">updateWindows</span><span class="style1"> handlers into the stack script of your stack.  You should probably also copy the </span><span class="style2">hideColorButtons</span><span class="style1"> handler as well, so you can clean up nicely.4).  Modify the </span><span class="style2">openStack</span><span class="style1"> handler to put the rect of the card window into the global variable </span><span class="style5">newCardRect</span><span class="style1">.5).  Modify the </span><span class="style2">closeStack</span><span class="style1"> handler to call </span><span class="style2">hideColorButtons</span><span class="style1"> (to be neat).6).  To get the windows to actually do things like buttons when you click on them, use the </span><span class="style2">mouseUpInPicture</span><span class="style1"> handler with the name of the window.  For example:on mouseUpInPicture wName  if wName is "Calvin" then play sound "Bang"  if wName is "Mac with Apple" then go card "Profit Sharing"         .         .         .end mouseUpInPicture(Note:  These won't actually work -- they are examples only.  And if you use lots of color windows, and run under multifinder on a color system, you might consider increasing the memory allocation to HyperCard, perhaps to 1500k or more.)Since wName is sent automatically by HyperCard along with </span><span class="style2">mouseUpInPicture</span><span class="style1"> when a window is clicked in, you'll always know which window was clicked.  Very handy for our purposes.</span><span class="style4">How It Works:</span><span class="style1">On </span><span class="style2">openStack</span><span class="style1">, the current rect of the card window is saved in a global variable, </span><span class="style5">newCardRect</span><span class="style1">.  When the rect is moved, which we tell by using the moveWindow system message, then put that global variable into another variable, </span><span class="style5">oldCardRect</span><span class="style1">, since it now represents the previous location of the card.  Then put the new rect into </span><span class="style5">newCardRect</span><span class="style1">.  Now we have two rects, and by passing them to the </span><span class="style2">figureDelta</span><span class="style1"> function, we can figure the amount of movement in the two directions, up and down or right and left.Then the </span><span class="style2">updateWindows</span><span class="style1"> handler, using the result of the </span><span class="style2">figureDelta</span><span class="style1"> function, actually moves all my windows.  It does this by comparing the list I've compiled of what my windows are (the </span><span class="style2">windowNames</span><span class="style1"> function) against the built-in HyperTalk function </span><span class="style2">windows()</span><span class="style1">, which shows all open windows.Yes, I know it's slow and awkward.  Oh well.  But look at those nice color icons.</span></text>
  111.     </content>
  112.     <name></name>
  113.     <script></script>
  114. </card>
  115.  
  116.  
  117.